package com.bsfcs.rag.repository;

import com.bsfcs.rag.entity.ContractLxPlan;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ContractLxPlanRepository extends JpaRepository<ContractLxPlan, String>  {
    /**
     * 根据多个合同ID查询并分组
     */
    @Query("SELECT l FROM ContractLxPlan l WHERE l.parentID IN :contractIds")
    List<ContractLxPlan> findByContractIdsGrouped(@Param("contractIds") List<String> contractIds);
}
